Skip to content

✨ Restrict running sessions to one concurrent one#260

Open
a-kenji wants to merge 3 commits intomainfrom
ke-lock-unique-exclusive
Open

✨ Restrict running sessions to one concurrent one#260
a-kenji wants to merge 3 commits intomainfrom
ke-lock-unique-exclusive

Conversation

@a-kenji
Copy link
Collaborator

@a-kenji a-kenji commented Feb 15, 2026

Restrict running sessions to one concurrent one.
Uses the XDG_RUNTIME_DIR to hold an exclusive runtime lock.

As opposed to #258, we don't block starting a new session on the lock,
but clean up the old session and start a new session.

The end result is similar: There will only be one centerpiece session
open at the same time.

Alternatives:

  • Use ✨ Restrict running sessions to one concurrent one #258 for the other behavior
  • Link directly to the C functions for kill, but we depend on libc
    transitively anyway already
  • shell out to the kill command, this would mean we depend on the
    external kill command for this functionality

Restrict running sessions to one concurrent one.
Uses the `XDG_RUNTIME_DIR` to hold an exclusive runtime lock.
The lock is automatically cleaned up upon exit.

An earlier implementation used the `fs4` crate, but
now this functionality is in the `stdlib` since `rustc --version`: `1.89.0`.

Closes: #179
Supercedes: #182
Alternatively we could also add a drop `impl`, and call `eguis` native exit
handling.
Restrict running sessions to one concurrent one.
Uses the `XDG_RUNTIME_DIR` to hold an exclusive runtime lock.

As opposed to #258, we don't block starting a new session on the lock,
but clean up the old session and start a new session.

The end result is similar: There will only be one `centerpiece` session
open at the same time.

Alternatives:
- Use #258 for the other behavior
- Link directly to the C functions for kill, but we depend on `libc`
  transitively anyway already
- shell out to the `kill` command, this would mean we depend on the
  external `kill` command for this functionality
@a-kenji a-kenji force-pushed the ke-lock-unique-exclusive branch from eb214cc to 06e7ea4 Compare February 15, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant